home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 561 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: lars.farm@nts.mh.se (Lars Farm)
  3. Newsgroups: comp.std.c++
  4. Subject: Is dynamic_cast safe?
  5. Date: 27 Feb 1996 16:01:15 GMT
  6. Organization: pv
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <AD58B8389668E1A9@sleipner.nts.mh.se>
  9. NNTP-Posting-Host: taumet.eng.sun.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset="iso-8859-1"
  12. Content-Transfer-Encoding: 8bit
  13. X-Nntp-Posting-Host: sleipner.nts.mh.se
  14. X-Lines: 14
  15. Content-Length: 503
  16. Originator: clamage@taumet
  17.  
  18.      5.2.6  Dynamic cast                           [expr.dynamic.cast]
  19.    ...
  20.    6 Otherwise,  v shall be a pointer to or an lvalue of a polymorphic type
  21.    ...
  22. What should happen when 'v' is not a pointer to or an lvalue of a
  23. polymorphic type? return 0? crash? throw bad_cast? undefined?
  24.    ...
  25.    8 The  run-time  check  logically  executes  like  this: 
  26.      [...]  Otherwise, the run-time  check fails.
  27.  
  28. If fail means undefined, why not require that it returns 0?
  29.  
  30. --
  31. Lars Farm, lars.farm@nts.mh.se
  32.  
  33.  
  34. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your
  35.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  36.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  37.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  38.   Comments? mailto:std-c++-request@ncar.ucar.edu
  39. ]
  40.